package com.example.medicine.View;

import com.example.medicine.Bean.zhengzhuang;
import com.example.medicine.Mapper.zyjbMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@Slf4j
@Controller
public class zyjbView {
    @Autowired
    private zyjbMapper zyjbMapper;
    /**
     * 展示中医疾病列表
     * @return
     */
    @RequiresPermissions("中医疾病库TCD")
    @RequestMapping("/zyjb")
    public String zyjbShow(){
        log.info("中医疾病列表页面");
        return "pages/zyjb/list";
    }
    @RequiresPermissions("中医疾病库TCD")
    @RequestMapping("/zyjb/create")
    public String xyjbCreateShow(){
        log.info("中医疾病创建页面");
        return "pages/zyjb/create";
    }
    /**
     * zyjb编辑展示页面
     */
    @RequiresPermissions("中医疾病库TCD")
    @GetMapping("/zyjb/edit/{id}")
    public String getTeamById(@PathVariable int id, Model model){
        log.info("中医疾病编辑页面");
        zhengzhuang zhengzhuang=zyjbMapper.getById(id);
        zhengzhuang.setId(id);
        model.addAttribute("zhengzhuang", zhengzhuang);
        return "pages/zyjb/edit";
    }
}